<template>
	<view class="home hv100 bg-white clearfix ">
		<cu-custom bgColor="bg-white color-black">
			<block slot="content"></block>
			<view slot="right" class="wp100 px15 discenter">
				<view class="flex align-center justify-between   wp100 ">
					<view class="flex align-center justify-start search-text">
						<text class="cuIcon-back f16" @click="backpe"></text>
						<view class="discenter search mt5 ml10">
							<view class="bg-shop radius-30 h35 flex align-center justify-start wp100 pl15">
								<text class="cuIcon-search color-info mr5 "></text>
								<input v-model="searchtext" placeholder="请输入您要搜索的内容..." placeholder-class="color-info" class="color-black" />
							</view>
						</view>
					</view>
					<text class="f16" v-if="searchtext!=''" @click="searchto">搜索</text>
					<text class="f16 color-info" v-else >搜索</text>
				</view>
			</view>
		</cu-custom>
	</view>
</template>

<script>
import { mapState, mapActions } from 'vuex'
export default {
	data() {
		return {
			searchtext:'',
			dataList:[]
		}
	},
	onShow() {
		//this.getData()
	},
	computed:{
		...mapState(['baseURL']),
	},
	methods: {
		...mapActions(['setLocale','setClass']),
		async getData() {
			let { 
				data:{centerImg,goods,top,type}
			} = await this.$http.post('app.index', {}, { tipConfig: { storeBlock: true } })
			this.nav=type
			this.centerImg=centerImg
			this.banner=top
			this.hotgoods=goods
		},
		searchto(){
			uni.navigateTo({
				url:'searchend?title='+this.searchtext
			})
		},
		backpe(){
			uni.navigateBack({
				delta:1
			})
		}
	}
}
</script>
<style lang="less">
.search{
	width: calc(100% - 60rpx);
}
.search-text{
	width: calc(100% - 80rpx);
}
.wp25{
	width: 25%;
}
.bg-shop{
	background-color: #F7F7F7;
}
</style>
